<?php
$table_structure = array(
    'top'                   => array(
        'top_brand_hot'  => array(
                                'ddl'           => "CREATE TABLE `%s`.`top_brand_hot%s` (
                                                    `brandId` int(11) NOT NULL AUTO_INCREMENT,
                                                    `topId` int(11) NOT NULL COMMENT '所属类目ID',
                                                    `brandKeyword` varchar(100) NOT NULL COMMENT '关键词',
                                                    `brandAttention` int(11) NOT NULL COMMENT '关注指数',
                                                    `brandUpRange` int(11) NOT NULL COMMENT '升降幅度',
                                                    `brandUpRank` int(11) NOT NULL COMMENT '升降位次',
                                                    `brandRanking` int(11) NOT NULL COMMENT '当前排名',
                                                    `brandUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                                    PRIMARY KEY (`brandId`),
                                                    KEY `brandKeyword` (`brandKeyword`),
                                                    KEY `brandUpdateTime` (`brandUpdateTime`)
                                                  ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
                                'update_column' => 'brandUpdateTime'),
        'top_brand_up'   => array(
                                'ddl'           => "CREATE TABLE `%s`.`top_brand_up%s` (
                                                   `brandId` int(11) NOT NULL AUTO_INCREMENT,
                                                   `topId` int(11) NOT NULL COMMENT '所属ID',
                                                   `brandKeyword` varchar(100) NOT NULL COMMENT '关键词',
                                                   `brandAttention` int(11) NOT NULL COMMENT '关注指数',
                                                   `brandUpRange` int(11) NOT NULL COMMENT '升降幅度',
                                                   `brandUpRank` int(11) NOT NULL COMMENT '升降位次',
                                                   `brandRanking` int(11) NOT NULL COMMENT '当前排名',
                                                   `brandUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                                   PRIMARY KEY (`brandId`),
                                                   KEY `brandKeyword` (`brandKeyword`),
                                                   KEY `brandUpdateTime` (`brandUpdateTime`)
                                                 ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
                                'update_column' => 'brandUpdateTime'),
        'top_sale_hot'   => array(
                                'ddl'           => "CREATE TABLE `%s`.`top_sale_hot%s` (
                                                   `saleId` int(11) NOT NULL AUTO_INCREMENT,
                                                   `topId` int(11) NOT NULL COMMENT '所属类目ID',
                                                   `saleProductTitle` varchar(80) NOT NULL COMMENT '宝贝标题',
                                                   `saleProductId` bigint(20) NOT NULL COMMENT '宝贝ID',
                                                   `salePrice` float NOT NULL COMMENT '宝贝单价',
                                                   `saler` varchar(60) DEFAULT NULL COMMENT '卖家名称',
                                                   `salerAddress` varchar(60) NOT NULL COMMENT '卖家所在地区',
                                                   `saleUpRange` int(11) DEFAULT NULL COMMENT '升降幅度(百分比)',
                                                   `saleSellCount` int(11) DEFAULT NULL COMMENT '宝贝当月销售业绩',
                                                   `saleRanking` int(11) DEFAULT NULL COMMENT '当前排名',
                                                   `saleUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                                   PRIMARY KEY (`saleId`),
                                                   KEY `saleUpdateTime` (`saleUpdateTime`),
                                                   KEY `saler` (`saler`)
                                                 ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
                                'update_column' => 'saleUpdateTime'),
        'top_sale_up'    => array(
                                'ddl'           => "CREATE TABLE `%s`.`top_sale_up%s` (
                                                   `saleId` int(11) NOT NULL AUTO_INCREMENT,
                                                   `topId` int(11) NOT NULL COMMENT '所属类目ID',
                                                   `saleProductTitle` varchar(80) NOT NULL COMMENT '宝贝标题',
                                                   `saleProductId` bigint(20) NOT NULL COMMENT '宝贝ID',
                                                   `salePrice` float NOT NULL COMMENT '宝贝单价',
                                                   `saler` varchar(60) DEFAULT NULL COMMENT '卖家名称',
                                                   `salerAddress` varchar(60) NOT NULL COMMENT '卖家所在地区',
                                                   `saleUpRange` int(11) DEFAULT NULL COMMENT '升降幅度(百分比)',
                                                   `saleSellCount` int(11) DEFAULT NULL COMMENT '宝贝当月销售业绩',
                                                   `saleRanking` int(11) DEFAULT NULL COMMENT '当前排名',
                                                   `saleUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                                   PRIMARY KEY (`saleId`)
                                                 ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
                                'update_column' => 'saleUpdateTime'),
        'top_search_hot' => array(
                                'ddl'           => "CREATE TABLE `%s`.`top_search_hot%s` (
                                                   `searchId` int(11) NOT NULL AUTO_INCREMENT,
                                                   `topId` int(11) NOT NULL COMMENT '所属类目ID',
                                                   `searchKeyword` varchar(100) NOT NULL COMMENT '关键词',
                                                   `searchAttention` int(11) NOT NULL COMMENT '关注指数',
                                                   `searchUpRange` int(11) NOT NULL COMMENT '升降幅度',
                                                   `searchUpRank` int(11) NOT NULL COMMENT '升降位次',
                                                   `searchRanking` int(11) NOT NULL COMMENT '当前排名',
                                                   `searchUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                                   PRIMARY KEY (`searchId`)
                                                 ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
                                'update_column' => 'searchUpdateTime'),
        'top_search_up'  => array(
                                'ddl'           => "CREATE TABLE `%s`.`top_search_up%s` (
                                                   `searchId` int(11) NOT NULL AUTO_INCREMENT,
                                                   `topId` int(11) NOT NULL COMMENT '所属类目ID',
                                                   `searchKeyword` varchar(100) NOT NULL COMMENT '关键词',
                                                   `searchAttention` int(11) NOT NULL COMMENT '关注指数',
                                                   `searchUpRange` int(11) NOT NULL COMMENT '升降幅度',
                                                   `searchUpRank` int(11) NOT NULL COMMENT '升降位次',
                                                   `searchRanking` int(11) NOT NULL COMMENT '当前排名',
                                                   `searchUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                                   PRIMARY KEY (`searchId`)
                                                 ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
                                'update_column' => 'searchUpdateTime')
    ),
    'top_today_attention'   => "CREATE TABLE `%s`.`top_today_attention%s` (
                                  `todayId` int(11) NOT NULL AUTO_INCREMENT,
                                  `todayKeyword` varchar(100) NOT NULL COMMENT '关键词',
                                  `todayAttention` int(11) NOT NULL COMMENT '关注指数',
                                  `todayUpRange` int(11) NOT NULL COMMENT '升降幅度',
                                  `todayUpRank` int(11) NOT NULL COMMENT '升降位次',
                                  `todayRanking` int(11) NOT NULL COMMENT '当前排名',
                                  `todayUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                  PRIMARY KEY (`todayId`)
                                ) ENGINE=MyISAM DEFAULT CHARSET=gbk;",
    'top_weekday_attention' => "CREATE TABLE `%s`.`top_weekday_attention%s` (
                                  `weekdayId` int(11) NOT NULL AUTO_INCREMENT,
                                  `weekdayKeyword` varchar(100) NOT NULL COMMENT '关键词',
                                  `weekdayAttention` int(11) NOT NULL COMMENT '关注指数',
                                  `weekdayUpRange` int(11) NOT NULL COMMENT '升降幅度',
                                  `weekdayUpRank` int(11) NOT NULL COMMENT '升降位次',
                                  `weekdayRanking` int(11) NOT NULL COMMENT '当前排名',
                                  `weekdayUpdateTime` datetime NOT NULL COMMENT '抓取时间',
                                  `is_run` tinyint(1) NOT NULL DEFAULT '0',
                                  PRIMARY KEY (`weekdayId`)
                                ) ENGINE=MyISAM DEFAULT CHARSET=gbk;"
);
?>
